package com.itshen.dto;

import lombok.Data;

import java.util.Objects;

@Data
public class ItemDTO {
    private Long id;
    private String name;
    private Integer price;
    private Integer stock;
    private String brand;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ItemDTO itemDTO = (ItemDTO) o;
        return Objects.equals(id, itemDTO.id) &&
                Objects.equals(name, itemDTO.name) &&
                Objects.equals(price, itemDTO.price) &&
                Objects.equals(stock, itemDTO.stock) &&
                Objects.equals(brand, itemDTO.brand);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, price, stock, brand);
    }
}
